<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>产品列表</title>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<style type="text/css">
	body{
		overflow-y: hidden;
	}
    #dv {
        background-color: white;
        width: 96%;
        margin: 20px 20px auto;
    }
</style>

<body bgcolor="whitesmoke">

<div id="dv">
    </br>
    &nbsp;&nbsp;&nbsp;&nbsp;<i class="layui-icon layui-icon-cart-simple" style="width: 150px;height: 100px;"><b>产品管理</b></i>
    </br></br>
    <table class="layui-hide" id="test" lay-filter="test"></table>
</div>

<script src="../../js/jquery3.js"></script>
<script src="../../layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->

<script>
    $(function () {
        $.post("/user/getSelf", {}, function (data) {
            if (data != null) {
                layui.use('table', function () {
                    var table = layui.table;

                    table.render({
                        elem: '#test'
                        , url: '/product/findAll'
                        , title: '订单数据表',

                            method:'post',
                            page: {
                                limits:[5,10,15,20],
                                limit: 5,
                                theme: '#5FB878',            },


                        cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
                        , cols: [[
                            {type: 'checkbox', fixed: 'left'},
                            {
                                title: '序号',
                                type:"numbers",
                            },
                            , {field: 'prId', title: 'id', fixed: 'left',hide:true}
                            , {field: 'prName', title: '产品名称'}
                            , {field: 'prNum', title: '存量'}
                            , {field: 'prPrice', title: '单价'}
                            , {field: 'prStatus', title: '产品状态'},
                            {
                                field: 'prDescribe',
                                title: '产品描述'
                            }
                            , {field: 'prCreatDate', title: '创建时间'}
                            , {field: 'prUpdateDate', title: '修改时间'},

                            {field: 'prEndPerson', title: "最后操作人"}
                        ]]
                    });


                });
            } else {
                alert("未登录，请先登录")
                location.href = "../login/login.html"
            }
        })


    })
</script>

</body>
</html>
</body>
</html>
